<html>

<head>
    <script language="JavaScript">
        function httpRequest() {
            fetch('https://www.ixigua.com/na/monorepo/bff/api/lvideo_filter/get_category_lvideos?limit=18&offset=36&pinyin=dianshiju&filters={%22type%22:%22%E7%94%B5%E8%A7%86%E5%89%A7%22,%22area%22:%22%E5%85%A8%E9%83%A8%E5%9C%B0%E5%8C%BA%22,%22tag%22:%22%E5%85%A8%E9%83%A8%E7%B1%BB%E5%9E%8B%22,%22sort%22:%22%E7%BB%BC%E5%90%88%E6%8E%92%E5%BA%8F%22,%22paid%22:%22%E5%85%A8%E9%83%A8%E8%B5%84%E8%B4%B9%22}&aid=1768')
                .then(response => response.text())
                .then(data => {
                    console.log(data);
                    alert(data);
                })
                .catch(error => {
                    alert("Error: " + error);
                }
                );
        }
        httpRequest();

        function xhrRequest() {
            try {
                var xhr = new XMLHttpRequest();
                xhr.open('GET', 'https://www.ixigua.com/na/monorepo/bff/api/lvideo_filter/get_category_lvideos?limit=18&offset=36&pinyin=dianshiju&filters={%22type%22:%22%E7%94%B5%E8%A7%86%E5%89%A7%22,%22area%22:%22%E5%85%A8%E9%83%A8%E5%9C%B0%E5%8C%BA%22,%22tag%22:%22%E5%85%A8%E9%83%A8%E7%B1%BB%E5%9E%8B%22,%22sort%22:%22%E7%BB%BC%E5%90%88%E6%8E%92%E5%BA%8F%22,%22paid%22:%22%E5%85%A8%E9%83%A8%E8%B5%84%E8%B4%B9%22}&aid=1768', true);
                xhr.onreadystatechange = function () {
                    console.log('xhr.onreadystatechange' + xhr.readyState + ': ' + xhr.status);
                    if (xhr.readyState == 4 && xhr.status == 200) {
                        var response = JSON.stringify(xhr);
                        console.log(response);
                    }
                };
                xhr.send();
            } catch (error) {
                alert(error);
            }
        }
        xhrRequest();
    </script>
</head>

<body onload="myFunction()">
    <h1>hello</h1>
    <div id="aa"></div>
    <script>
        function myFunction() {
            
            <!--    httpRequest('https://haokan.baidu.com/videoui/list/tab');-->
            xhrRequest('https://www.ixigua.com/na/monorepo/bff/api/lvideo_filter/get_category_lvideos');
            document.getElementById('aa').innerHTML = '<h1>aabbcc</h1>';
        }
    </script>
</body>

</html>